#include <gtk/gtk.h>
#include "exit.h"
#include "file.h"

gboolean exit_easyblog(struct file_ctrl *global_file)
{
	struct file_list *each,*tmp;
	gchar command[80];
	#ifdef _DEBUG_
		printf("exit_easyblog:------\n");
	#endif
	g_snprintf(command,80,"rm  %s/*",global_file->tmp);
	printf("rm %s\n",global_file->tmp);
	system(command);
	if(global_file->home)
		free(global_file->home);
	if(global_file->config)
		free(global_file->config);
	if(global_file->tmp)
		free(global_file->tmp);
	if(global_file->data)
		free(global_file->data);
	if(global_file->groups)
		free(global_file->groups);
	for(tmp=each=global_file->files;each->next!=NULL;) {
		#ifdef _DEBUG_
			printf("free name: %s\n",each->name);
		#endif
		if(each->columns)
			free(each->columns);
		each=each->next;
		if(tmp)
			free(tmp);
		tmp=each;
	}

	return TRUE;
}
